<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="panel panel-default">
	<div class="panel-heading">
		<div class="panel-title">管理中心</div>
	</div>
	<div class="panel-body">
		<div class="sider">${menuTree }</div>
	</div>
</div>

<c:if test="${not empty menuTree }">
	<script type="text/javascript">
	$(function(){
		$(".tree").treeview({animated: "fast",persist: "location"});
	})
	</script>
</c:if>
<c:if test="${not empty USER_SESSION }">
	<script type="text/javascript">
	$.ajax({
        type: "GET",
        url: "admin/sidebar",
        data: {},
        dataType: "html",
        success: function(data) {//data:请求成功后的回调函数data();服务器根据dataType来返回
            $(".sider").html(data);
            $(".tree").treeview({animated: "fast",persist: "location"});
        }
    });
	</script>
</c:if>
